print('给出一个list[int],舍弃大于50的数\n')
'''def giveup_number_fifty(*a):
    while True:
        a = input('输入数会舍弃大于50的数:')
        if a == 'over':
            print('已退出')
            break
        a = list(a)
        for i in a:
            a.sort()
            print(a)
            break
giveup_number_fifty([1,2,3])'''

def number_fifty(*a):
    for i in a:
        a = list(a)
        if i > 50:
            a.remove(i)
            print(a)
number_fifty(1,49,51,52)
print('给出一个list[int],舍弃大于50的数并进行排序\n')
#         用 append, 不可边删边减,容易出问题
def sort1_giveup_fifty(*tuple1):
    for i in tuple1:
        tuple1 = list(tuple1)
        tuple1.sort()
        if i > 50:
            tuple1.remove(i)
    return tuple1
sort1_giveup_fifty(5,49,6,51,46,69)
print('给出一个list[int],去重\n')
def qu_chong(a):
    a = set(a)
    print(a)
qu_chong([2,2,5,5,66,66])
print('给出一个list[int],计算每个元素出现的次数')

def count1(n):
    x = 0
    for i in n:
        if i not in n[:x]:
            print(i,n.count(i))
        x += 1

    return n
count1([2,2,2,6,6,6,9,9,1])

print('给出一个list2[int],计算每个元素出现的次数')
list1 = [2,2,2,6,6,6,9,9,1]
def count1(n):
    dict1 = {}
    for i in n:
        dict1[i] = list1.count(i)
    return dict1
print(count1(list1))
print('给出一个list3[int],计算每个元素出现的次数')
list1 = [2,2,2,6,6,6,9,9,1]
def count1(n):
    dict1 = {}
    for i in n:
        dict2 = dict1.fromkeys(i)
        dict2[i] = list1.count(i)
        
        
    
